'''
练习1：
将字符串welcome to python中的所有单词首字母变成大写
'''
s = 'welcome to python'

# 方法1
# a = s[0:7]
# b = s[8:10]
# c = s[11:]
# s = a.capitalize() + ' ' + b.capitalize() + ' ' + c.capitalize()

# 方法2
# l = s.split(' ')
# s = l[0].capitalize() + ' ' +l[1].capitalize() + ' ' + l[2].capitalize()

# 方法3
# print(s.title())



'''
练习2：
将字符串aBC Def Python Hello通过操作将其改为HELLO-PYTHON-DEF-ABC
'''
s = 'aBC Def Python Hello'

# 方法1
l = s.upper().split()
# s = l[3] + '-' + l[2] + '-' + l[1] + '-' + l[0]

# 方法2
l.reverse() #  颠倒
s = '-'.join(l)
print(s)